package org.zxl.springbootdemo.springjdbc2.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zxl.springbootdemo.springjdbc2.dao.ZqhDAO;
import org.zxl.springbootdemo.springjdbc2.entity.ZqhDiary;

import java.util.List;

@Service
public class ZqhService {
    @Autowired
    private ZqhDAO zqhDAO;

    public void insert(ZqhDiary zqhDiary){
        zqhDAO.insert(zqhDiary);
    }

    public void insert(List<ZqhDiary> zqhDiarys){
        zqhDiarys.stream().forEach(zqh -> { zqhDAO.insert(zqh);});
    }
}
